import request from "@/utils/request";

/**
 * 创建订单
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export function generateOrder(data) {
    return request({
        url: '/medicine/orders/createOrders',
        method: 'post',
        data: data
    })
}

/**
 * 生成订单
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export function generateConfirmOrder(data) {
    return request({
        method: 'POST',
        url: '/medicine/orders/genOrders',
        data: data
    })
}
export function fetchOrder(data) {
    return request({
        url: '/medicine/orders/'+data,
        method: 'get'
    })
}

export function fetchAliapyStatus(data) {
    return request({
        url: '/pay/pay/query',
        method: 'get',
        data: data
    })
}
export function fetchOrderList(data) {
    return request({
        url: '/medicine/orders/getOrderList',
        method: 'post',
        data: data
    })
}
//修改订单状态
export function updateUserOrder(data) {
    return request({
        url: '/medicine/orders/updateOrderStatus',
        method: 'post',
        data: data
    })
}
//查看订单详情
export function fetchOrderDetailNum(data) {
    return request({
        url: '/medicine/orders/getOrderDetailById/'+data,
        method: 'get'
    })
}

export function getOrderInfo(data) {
    return request({
        url: '/medicine/orders/getOrderInfo/'+data,
        method: 'get'
    })
}//
